from selenium import webdriver
import time

#
# options = webdriver.ChromeOptions()  # 创建option对象
# user_data_dir = r'--user-data-dir=C:\Users\43927\AppData\Local\Google\Chrome\User Data'  # 复制路径 chrome/://version
# options.add_argument(user_data_dir)
#
# driver = webdriver.Chrome(options=options)
# driver.get('https://mail.qq.com/')


driver = webdriver.Chrome()
driver.get('https://mail.qq.com/')
time.sleep(2)

qq_login_tab = driver.find_element_by_id('qqLoginTab')
qq_login_tab.click()

login_frame = driver.find_element_by_id('login_frame')  # 定位框架
driver.switch_to.frame(login_frame)
time.sleep(1)
user = driver.find_element_by_id('u')  # 输入账户
user.send_keys('439278957')
time.sleep(1)
password = driver.find_element_by_id('p')  # 输入密码
password.send_keys('00000000')
time.sleep(1)
login = driver.find_element_by_id('login_button')  # d点击登录
login.click()
